<template>
    <div>
      
      <h1>获取网络图片</h1>
        <img src="https://picsum.photos/200/300" alt="">
    </div>
  </template>
   
  <script>
  import axios from 'axios';
   
  export default {
    data() {
      return {
        imageurl:'',
        content: null
      };
    },
    created() {
      this.fetchData();
    },
    methods: {
      fetchData() {
        axios.get('https://picsum.photos/200/300')
          .then(response => {
            this.content = response.data;
            console.log(response.data);
            
          })
          .catch(error => {
            console.error('There was an error!', error);
          });
      }
    }
  };
  </script>